#!/bin/bash

CREATE USER repl REPLICATION SYSADMIN LOGIN ENCRYPTED PASSWORD 'repl@123'

GS_CLUSTER_NAME


# primary
export  GS_PASSWORD='gauss!23'
echo  ${GS_PASSWORD}| sh /opt/openGauss/install.sh --mode primary -D ${OPENGAUSS_DATA_DIR} -R ${OPENGAUSS_ROOT_DIR}  \
    -C "replconninfo1='localhost=172.11.0.2 localport=5432 remotehost=172.11.0.3  remoteport=5432'" --start

# standby
export  GS_PASSWORD='gauss!23'
echo  ${GS_PASSWORD}| sh /opt/openGauss/install.sh --mode standby -D ${OPENGAUSS_DATA_DIR} -R ${OPENGAUSS_ROOT_DIR}  \
    -C "replconninfo1='localhost=172.11.0.3 localport=5432 remotehost=172.11.0.2  remoteport=5432'" --start

echo ${GS_PASSWORD}| sh /opt/openGauss/install.sh --mode standby -D ${OPENGAUSS_DATA_DIR} -R ${OPENGAUSS_ROOT_DIR} -n standby1  -C "replconninfo1='localhost=172.11.0.3 localport=5432 remotehost=172.11.0.2  remoteport=5432'" --start 